 function bindEvent(ele,type,fn,selector){
    ele.addEventListener(type,event=>{
        const target=event.target;
        // 是否委托
        if(selector){
            if(target.matches(selector)){
                fn.call(target,event)
            }
        }else{
            // 不委托,普通调用
            fn.call(ele,event)
        }
    })
}
export default bindEvent
